(function ($) {  
	Drupal.behaviors.sdyz_support = {    
		attach: function(context, settings) {
			var slideX = {
				  //for first slide
			      thisUl: $('#block-sdyz-support-tab1 .tab-image-content ul.imgbox'),
			      btnLeft: $('#block-sdyz-support-tab1 .leftclick'),
			      btnRight: $('#block-sdyz-support-tab1 .rightclick'),
			      thisLi: $('#block-sdyz-support-tab1 .tab-image-content ul.imgbox li'),
			      init: function () {
			          slideX.thisUl.width(slideX.thisLi.length * 113);
			          //slideX.slideAuto();
			          slideX.btnLeft.click(slideX.slideLeft).hover(slideX.slideStop, slideX.slideAuto);
			          slideX.btnRight.click(slideX.slideRight).hover(slideX.slideStop, slideX.slideAuto);
			          slideX.thisUl.hover(slideX.slideStop, slideX.slideAuto);
			      },
			      slideLeft: function () {
			          slideX.btnLeft.unbind('click', slideX.slideLeft);
			          slideX.thisUl.find('li:last').prependTo(slideX.thisUl);
			          slideX.thisUl.css('marginLeft', -113);
			          slideX.thisUl.animate({ 'marginLeft': 0 }, 350, function () {
			              slideX.btnLeft.bind('click', slideX.slideLeft);
			          });
			          return false;
			      },
			      slideRight: function () {
			          slideX.btnRight.unbind('click', slideX.slideRight);
			          slideX.thisUl.animate({ 'marginLeft': 113 }, 350, function () {
			              slideX.thisUl.css('marginLeft', '0');
			              slideX.thisUl.find('li:first').appendTo(slideX.thisUl);
			              slideX.btnRight.bind('click', slideX.slideRight);
			          });
			          return false;
			      },
			      slideAuto: function () {
			          //slideX.intervalId = window.setInterval(slideX.slideRight, 3000);
			      },
			      slideStop: function () {
			          //window.clearInterval(slideX.intervalId);
			      }
			  }
			var slideX1 = {
				      //for second slide
				      thisUl1: $('#block-sdyz-support-tab6 .tab-image-content ul.imgbox'),
				      btnLeft1: $('#block-sdyz-support-tab6 .leftclick'),
				      btnRight1: $('#block-sdyz-support-tab6 .rightclick'),
				      thisLi1: $('#block-sdyz-support-tab6 .tab-image-content ul.imgbox li'),
				      init1: function () {
				          slideX1.thisUl1.width(slideX1.thisLi1.length * 113);
				          //slideX.slideAuto();
				          slideX1.btnLeft1.click(slideX1.slideLeft1).hover(slideX1.slideStop1, slideX1.slideAuto1);
				          slideX1.btnRight1.click(slideX1.slideRight1).hover(slideX1.slideStop1, slideX1.slideAuto1);
				          slideX1.thisUl1.hover(slideX1.slideStop1, slideX1.slideAuto1);
				      },
				      slideLeft1: function () {
				          slideX1.btnLeft1.unbind('click', slideX1.slideLeft1);
				          slideX1.thisUl1.find('li:last').prependTo(slideX1.thisUl1);
				          slideX1.thisUl1.css('marginLeft', -113);
				          slideX1.thisUl1.animate({ 'marginLeft': 0 }, 350, function () {
				              slideX1.btnLeft1.bind('click', slideX1.slideLeft1);
				          });
				          return false;
				      },
				      slideRight1: function () {
				          slideX1.btnRight1.unbind('click', slideX1.slideRight1);
				          slideX1.thisUl1.animate({ 'marginLeft': 113 }, 350, function () {
				              slideX1.thisUl1.css('marginLeft', '0');
				              slideX1.thisUl1.find('li:first').appendTo(slideX1.thisUl1);
				              slideX1.btnRight1.bind('click', slideX1.slideRight1);
				          });
				          return false;
				      },
				      slideAuto1: function () {
				          //slideX.intervalId = window.setInterval(slideX.slideRight, 3000);
				      },
				      slideStop1: function () {
				          //window.clearInterval(slideX.intervalId);
				      }
				  }
			  $(document).ready(function () {
			      slideX.init();
			      slideX1.init1();
			  })  
		}
	};
})(jQuery);